import Vue from 'vue'
import Router from 'vue-router'
import com from '@/components/test/com.vue'
import Home from '@/components/home/home.vue'
import News from '@/components/news/news.vue'
import current from '@/components/current/index'
import Policy from '@/components/Policy/index.vue'
import standard from '@/components/standard/index'
import Search from '../components/search/search.vue'
import a from '@/components/standard/components/a.vue'
import b from '@/components/standard/components/b.vue'
import c from '@/components/standard/components/c.vue'
import d from '@/components/standard/components/d.vue'
import input1 from '@/components/search/components/input'
import input2 from '@/components/search/components/input1'
import input3 from '@/components/search/components/input2'
import input4 from '@/components/search/components/input3'
import current1 from '@/components/current/components/current1'
import current2 from '@/components/current/components/current2'
import current3 from '@/components/current/components/current3'
import current4 from '@/components/current/components/current4'
import current5 from '@/components/current/components/current5'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home
    },
    {
      path: '/news',
      name: 'news',
      component: News
    },
    { // 嵌套子路由
      path: '/search',
      name: 'search',
      component: Search,
      children: [{
        path: 'input1',
        name: 'input1',
        alias: '',
        component: input1
      }, {
        path: 'input2',
        name: 'input2',
        component: input2
      }, {
        path: 'input3',
        name: 'input3',
        component: input3
      }, {
        path: 'input4',
        name: 'input4',
        component: input4
      }
      ]
    },
    {
      path: '/policy',
      name: 'pilicy',
      component: Policy
    },
    {
      path: '/standard',
      component: standard,
      children: [{
        path: 'a',
        alias: '', // 配置别名 默认选中
        name: 'a',
        component: a
      }, {
        path: 'b',
        name: 'b',
        component: b
      }, {
        path: 'c',
        name: 'c',
        component: c
      }, {
        path: 'd',
        name: 'd',
        component: d
      }]
    },
    {
      path: '/com',
      name: 'com',
      redirect: {name: 'Home'},
      component: com,
      children: [{
        path: '/a',
        component: a
      }, {
        path: '/b',
        component: b
      }, {
        path: '/c',
        component: c
      }]
    },
    {
      path: '/current',
      component: current,
      name: 'current',
      children: [{
        path: 'current1',
        name: 'current1',
        alias: '',
        component: current1
      }, {
        path: 'current2',
        name: 'current2',
        component: current2
      }, {
        path: 'current3',
        name: 'current3',
        component: current3
      }, {
        path: 'current4',
        name: 'current4',
        component: current4
      }, {
        path: 'current5',
        name: 'current5',
        component: current5
      }]
    }
  ]
})
